package com.ljx;

import org.mybatis.spring.annotation.MapperScan;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@MapperScan(basePackages = "com.ljx.dao")
public class RedisLockApplication {

	public static void main(String[] args) {
		SpringApplication.run(RedisLockApplication.class, args);
	}
	@Bean
	public RedissonClient redisson(){
		// 1. Create config object
		Config config = new Config();
		config.useSingleServer()
				// use "rediss://" for SSL connection
				.setAddress("redis://192.168.126.132:6379");
		RedissonClient redisson = Redisson.create(config);
		return redisson;
	}

}
